<template>
  <div>
    <div class="banner">
      <img
        class="banner-img"
        src="//img1.qunarzz.com/sight/p0/1607/7c/7cda8b6782dabd80b4.img.jpg_600x330_8572a930.jpg"
        alt=""
        @click="handleBannerClick"
      >
      <div class="banner-info">
        <div class="banner-number">
          <span class="iconfont banner-icon">&#xe600;</span>
          15
        </div>
        <div class="banner-title">{{sightName}}</div>
      </div>
    </div>
    <fade-animation>
      <common-gallary
      :imgs='imgs'
       @close="handleGallaryClose"
       v-if="showGallary"
      ></common-gallary>
    </fade-animation>
  </div>
</template>

<script>
import CommonGallary from 'common/gallary/Gallary'
import FadeAnimation from 'common/fade/FadeAnimation'
export default {
  name: 'DetailBanner',
  props: {
    sightName: String
  },
  data () {
    return {
      imgs: [
        '//img1.qunarzz.com/sight/p0/1803/12/126471e0966aca5ba3.img.jpg_600x330_8b04e389.jpg',
        '//img1.qunarzz.com/sight/p0/1709/bf/bfe91441ab865b2ea3.img.jpg_600x330_18c9bfb7.jpg'
      ],
      showGallary: false
    }
  },
  components: {
    CommonGallary,
    FadeAnimation
  },
  methods: {
    handleBannerClick () {
      this.showGallary = true
    },
    handleGallaryClose () {
      this.showGallary = false
    }
  }
}
</script>

<style lang='stylus' scoped>
  .banner
    overflow hidden
    position relative
    height 0
    padding-bottom 55%
    &-img
      width 100%
    &-info
      position absolute
      width 100%
      padding 3vw 0
      box-sizing border-box
      color #fff
      bottom 0
      left 2vw
      background-image linear-gradient(top, rgba(0, 0, 0, 0),
       rgba(0, 0, 0, 0.5))
      .banner-title
        font-size .3rem
        font-weight 600
      .banner-number
        width 15%
        height .25rem
        text-align center
        padding .1rem
        line-height .25rem
        border-radius .2rem
        background-color rgba(0,0,0,.3)
        margin-bottom 1vw
      .banner-icon
        font-size .24rem
        margin-right .01rem
</style>
